package xyz.xtt.asset.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
import xyz.xtt.asset.service.ITblRemintAccountService;
import xyz.xtt.asset.vo.RemintAccountVo;
import xyz.xtt.common.response.ApiResult;

@Tag(name = "铸作权帐户管理", description = "铸作权帐户管理")
@Slf4j
@RequestMapping("/api/nft/asset")
@RestController
public class RemintAccountController {
	@Autowired
	private ITblRemintAccountService iTblRemintAccountService;

	@GetMapping("/remint_asset/get")
	public ApiResult<RemintAccountVo> get(@Valid @NotNull(message = "ID不能为空") Long id) {
		log.info("/api/nft/asset/remint_asset/get id:{}", id);
		return ApiResult.ok(iTblRemintAccountService.info(id));
	}

	@GetMapping("/get_remint_list")
	public ApiResult<List<RemintAccountVo>> getRemintList(@RequestHeader("uid") Long uid,
			@RequestParam(value = "currPage", defaultValue = "1") Integer currPage, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
		log.info("/api/nft/asset/remint_asset/get_remint_list uid:{},currPage:{},pageSize:{}", uid, currPage, pageSize);
		return ApiResult.ok(iTblRemintAccountService.getListByUserId(uid, currPage, pageSize));
	}
}
